﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace array
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = new int[] { 1,3,-4,6,7};
            int max , min , sum;
            if (a.Length > 0)
            {
                max = a[0];min = a[0];sum = a[0];
                for (int i = 1; i < a.Length; i++)
                {
                    sum += a[i];
                    max = a[i] > max ? a[i]:max;
                    min = a[i] < min ? a[i] : min;
                }
                Console.WriteLine($"The max of the array is:{max}.");
                Console.WriteLine($"The min of the array is:{min}.");
                Console.WriteLine($"The average of the array is:{sum/a.Length}.");
                Console.WriteLine($"The sum of the array is:{sum}.");
            }
            else
            {
                Console.WriteLine("The array is empty.");
            }
            Console.ReadKey();
        }
    }
}
